import request from '@/utils/request'

// 查询学期信息
export function getSemester() {
  return request({
    url: '/admin/expschedule/semester/get',
    method: 'GET'
  })
}

// 根据 id 查询学期信息
export function getSemesterById(id) {
  return request({
    url: `/admin/expschedule/semester/get/${id}`,
    method: 'GET'
  })
}

// 添加学期信息
export function addSemester(form) {
  return request({
    url: '/admin/expschedule/semester/save',
    method: 'POST',
    data: form
  })
}

// 更新学期信息
export function updateSemester(form) {
  return request({
    url: '/admin/expschedule/semester/update',
    method: 'POST',
    data: form
  })
}

// 设置主学期
export function setCurrentSemester(id) {
  return request({
    url: `/admin/expschedule/semester/set/${id}`,
    method: 'POST'
  })
}

// 删除学期
export function deleteSemester(id) {
  return request({
    url: `/admin/expschedule/semester/remove/${id}`,
    method: 'DELETE'
  })
}
